//
// Created by Felix on 24-4-24.
//

#ifndef GAZE_USERDTO_HPP
#define GAZE_USERDTO_HPP

#include "oatpp/core/macro/codegen.hpp"
#include "oatpp/core/Types.hpp"

#include "enum/Role.hpp"

#include OATPP_CODEGEN_BEGIN(DTO)

class UserResponseDto : public oatpp::DTO {

    DTO_INIT(UserResponseDto, DTO)

    DTO_FIELD_INFO(userId) {
        info->description = "user_id";
        info->required = true;
    } // UserId
    DTO_FIELD(Int32, userId, "user_id");

    DTO_FIELD_INFO(username) {
        info->description = "用户名";
        info->required = true;
    } // Username
    DTO_FIELD(String, username);

    DTO_FIELD_INFO(avatar) {
        info->description = "头像";
        info->required = true;
    } // Avatar
    DTO_FIELD(String, avatar);

    DTO_FIELD_INFO(role) {
        info->description = "角色";
        info->required = true;
    } // Role
    DTO_FIELD(Enum<Role>::AsString, role);

    DTO_FIELD_INFO(status) {
        info->description = "状态";
        info->required = true;
    } // Role
    DTO_FIELD(Int8, status);

    DTO_FIELD_INFO(createTime) {
        info->description = "创建时间";
        info->required = true;
    } // Create time
    DTO_FIELD(Int64, createTime, "create_time");

    DTO_FIELD_INFO(updateTime) {
        info->description = "更新时间";
        info->required = true;
    } // Update time
    DTO_FIELD(Int64, updateTime, "update_time");

    DTO_FIELD_INFO(deleteTime) {
        info->description = "删除时间";
        info->required = true;
    } // Delete time
    DTO_FIELD(Int64, deleteTime, "delete_time");
};

#include OATPP_CODEGEN_END(DTO)

#endif //GAZE_USERDTO_HPP
